import http from '@/basic/baseHttp/index'
import type * as T from '@/types/api/index'
import { netConfigUse } from '@/stores/modules/netConfig'
const loginApi: T.ILoginApi = {
  login(params) {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.login, params)
  },
  doInfo() {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.userInfo, {})
  },
  codeLogin(data) {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.userInfo, data)
  },
  sendCode(data) {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.userInfo, data)
  },
  updInfo(data) {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.updInfo, data)
  },
  updPass(data) {
    const { getNetConfig: netConfig } = netConfigUse()
    return http.request(netConfig.apis.updPass, data)
  }
}

export default loginApi
